<#-- 导入模版定义文件-->
<#include "../template/template_editPage.ftl">
<@edit title="课程回顾管理">
<body class="input">
<script type="text/javascript" charset="utf-8" src="${web_static}/kindeditor/kindeditor.js"></script>
<script type="text/javascript" charset="utf-8" src="${web_static}/kindeditor/lang/zh_CN.js"></script>
<script>
	$().ready( function() {
	
		var $validateErrorContainer = $("#validateErrorContainer");
		var $validateErrorLabelContainer = $("#validateErrorContainer ul");
		var $validateForm = $("#inputForm");
		var $tab = $("#tab");
	
		// Tab效果
		$tab.tabs(".tabContent", {
			tabs: "input"
		});
		
		// 表单验证
		$validateForm.validate({
			errorContainer: $validateErrorContainer,
			errorLabelContainer: $validateErrorLabelContainer,
			wrapper: "li",
			errorClass: "validateError",
			ignoreTitle: true,
			rules: {
				"courseRetrospectInfo.courseName": {
						required: true
				},
				"courseRetrospectInfo.videoPath": {
						url: true
				}
			},
			messages: {
				"courseRetrospectInfo.courseName": {
						required: "请选择活动标题"
				},
				"courseRetrospectInfo.videoPath": {
						url: "请输入合法的视频地址"
				} 
			},
			submitHandler: function(form) {
				$(form).find(":submit").attr("disabled", true);
				form.submit();
			}
		});
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list actionErrors as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
	});

KindEditor.ready(function(K) {
	var editor1 = K.create('textarea[name="content"]', {
		cssPath : '${web_static}/kindeditor/plugins/code/prettify.css',
		uploadJson : '${web_base}/go/course_retrospect!imgUpload.htm',
		fileManagerJson : '${web_base}/go/course_retrospect!fileManager.htm',
		allowFileManager : true,
		afterCreate : function() {
			var self = this;
			K.ctrl(document, 13, function() {
				self.sync();
				document.forms['inputForm'].submit();
			});
			K.ctrl(self.edit.doc, 13, function() {
				self.sync();
				document.forms['inputForm'].submit();
			});
		}
	});
});

		
</script>

<div class="body">
		<div class="inputBar">
			<h1><span class="icon">&nbsp;</span>新增课题回顾</h1>
		</div>
		<div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
			<div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
				<ul></ul>
			</div>
		</div>	
		
		<form id="inputForm" name="inputForm" class="validate" action="${web_base}/go/course_retrospect!save.htm" method="post" enctype="multipart/form-data">
			<table class="inputTable tabContent">
				<tr>
					<th>
						课程名称：
					</th>
					<td>
						<select name="courseRetrospectInfo.courseName" class="{required: true}" style="font-size: 14px">
						    <option value="" >请选择</option>
							<#if courses??>
                       		<#list courses as obj>
	                            <option value="${obj.courseId!},${(obj.courseName)!}" >
		                           <#if obj.courseName?? && obj.courseName?length gte 20>
			                                <#--//截取输出文字的长度-->
			                                ${obj.courseName?substring(0,20)}...
			                        <#else>
		                                ${(obj.courseName)!}
		                            </#if>
                               </option>
		                        </#list>
		                    </#if>
						</select>
						<label id="labelUrl" class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						视频地址：
					</th>
					<td>
						<input type="text" id="url" name="courseRetrospectInfo.videoPath" class="formText defaultInvalid url" />
					</td>
				</tr>
				<tr>
					<th>活动回顾内容：</th>
					<td>
						<textarea id="editor_id" name="content" style="width:800px;height:600px;"></textarea>
						<strong><span style="color:#E53333;">图片支持格式：gif,jpg,jpeg,png,bmp</span></strong><br />
						<strong><span style="color:#E53333;"> flash支持格式：swf,flv</span></strong><br />
						<strong><span style="color:#E53333;"> media支持格式：swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb</span></strong><br />
						<strong><span style="color:#E53333;"> 文件支持格式：doc,docx,xls,xlsx,ppt,htm,html,txt,zip,rar,gz,bz2</span></strong><br />
					</td>
				</tr>
			</table>
			<div class="buttonArea">
				<input type="submit" class="formButton" value="提  交" hidefocus="true" />&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" class="formButton" onclick="window.history.back(); return false;" value="取  消" hidefocus="true" />
			</div>
		</form>
	</div>
</body>
</@edit>